From a25c1343c81d0f8f8db3f0cea251b76624bf52ce Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 5 Apr 2004 13:41:01 +0000 Subject: [PATCH] Fix ordering of ele on output so we pass SAXCount -f -v=always -n and fix misguided "leak no memory" fix so we don't mangle multiple DTD's. --- gpsbabel/gpx.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 7807f0c86..4aca5e38e 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -805,15 +805,22 @@ gpx_rd_init(const char *fname) } #endif -static void -gpx_rd_deinit(void) +static +void +gpx_rd_deinit(void) { vmem_free(¤t_tag); vmem_free(&cdatastr); + /* + * Don't free schema_loc. It really is important that we preserve + * this across reads or else merges/copies of files with different + * schemas won't retain the headers. + * if ( xsi_schema_loc ) { xfree(xsi_schema_loc); xsi_schema_loc = NULL; } + */ if ( gpx_email ) { xfree(gpx_email); gpx_email = NULL; @@ -1068,16 +1075,16 @@ gpx_waypt_pr(const waypoint *waypointp) if (waypointp->creation_time) { gpx_write_time(waypointp->creation_time, "time"); } + if (waypointp->altitude != unknown_alt) { + fprintf(ofd, " %f\n", + waypointp->altitude); + } write_optional_xml_entity(ofd, " ", "name", oname); write_optional_xml_entity(ofd, " ", "cmt", waypointp->description); if (waypointp->notes && waypointp->notes[0]) write_xml_entity(ofd, " ", "desc", waypointp->notes); else write_optional_xml_entity(ofd, " ", "desc", waypointp->description); - if (waypointp->altitude != unknown_alt) { - fprintf(ofd, " %f\n", - waypointp->altitude); - } if (waypointp->url) { tmp_ent = xml_entitize(waypointp->url); fprintf(ofd, " %s%s\n", urlbase ? urlbase : "", tmp_ent); -- 2.30.2